
function calc(start, minus, elm) {
	var sum = 0;
	var a = 0;
	Number(start);
	
	Number(minus);
	$(".price").each(function (index) {
			//  alert('Field' + index + ': ' + $(this).val());
			a = $(this).val().replace(".", "");
			sum += Number(a);
	});
	start -= sum;
	if ($(".income").val() != "") {
		a = $(".income").val().replace(".", "");
		start = Number(start) + Number(a);
	}
	sum = Number(sum) + Number(minus);
	sum = Math.floor(sum / 100) + "." + sum % 100;
	start = Math.floor(start / 100) + "." + start % 100;
	$("#sum").html("Обща сума: <strong>" + sum + "лв.</strong>, остават: <strong>" + start + "лв.</strong>");
	$(elm).prev().removeAttr("disabled");
}
 